package com.fyi.service.impl;

import com.fyi.entity.Admin;
import com.fyi.mapper.AdminMapper;
import com.fyi.service.AdminService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("adminService")
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    public Admin login(String adminName,String password) {
        return adminMapper.login(adminName,password);
    }

    public List<Admin> selectAllAdmin() {
        return adminMapper.selectAllAdmin();
    }

    public Integer addAdmin(Admin admin) {
        return adminMapper.addAdmin(admin);
    }

    public Integer updateAdmin(Admin admin) {
        return adminMapper.updateAdmin(admin);
    }

    public Integer deleteAdmin(Integer id) {
        return adminMapper.deleteAdmin(id);
    }

    public Admin selectById(Integer id) {
        return adminMapper.selectById(id);
    }

    public Admin selectByName(String name) {
        return adminMapper.selectByName(name);
    }
}
